Apple, the Apple logo, and Macintosh are registered trademarks of Apple Computer, Inc.
Mac and OpenDoc are trademarks of Apple Computer, Inc.
Frame Groups and Sequence Numbers
OpenDoc frames have two properties that can be used to indicate relationships among sibling frames within a containing part. The FrameGroup property indicates that two or more frames should be considered part of a group, and the SequenceNumber property describes the ordering within the group.
The ODFrame API includes the following calls for getting and setting the frame group and sequence number:
A frame's containing part has ownership of its FrameGroup and SequenceNumber; the containing part is the only object that may change those values. Only the containing part may call SetFrameGroup and SetSequenceNumber on an embedded frame.
If a frame is not grouped with any other frames, its FrameGroup and SequenceNumber properties should both be set to zero. This is the default state for a frame when it is created, so the containing part doesn't need to set it to be that way.
When a containing part responds to a RequestEmbeddedFrame call, it should place the new frame in the same group as the baseFrame, and should give the new frame a sequence number equal to the new size of the group. If the baseFrame was previously ungrouped (FrameGroup was zero), it should first be given a new group ID and a sequence number of one. Valid sequence numbers are contiguously allocated positive integers. If a frame is removed from the middle of a group, the frames above it should be renumbered so their sequence numbers are continguous.
A containing part may have a user interface that allows grouping and sequencing of embedded frames, but whether that is appropriate depends on the part's content model.
Embedded Part Perspective
When an embedded part requests an additional display frame from its containing part (via RequestEmbeddedFrame), the new frame will be in the same frame group as the baseFrame, and will have the highest sequence number in that group. Newly created frames have a frame group and sequence number of zero; the containing part sets those values shortly after creating the new frame. So the embedded part will receive a DisplayFrameAdded call with the new frame, and shortly after a SequenceChanged call notifying it of the new sequence number.
An embedded part has no control over the sequence ordering of its frames. However, it does have complete control over what content it displays within those frames. So if the part needs to change how its content is displayed in a group of frames, it doesn't need to change their sequence numbers, just how it maps those numbers to content display. But in most cases, the mapping should be pretty straightforward – you do want to respect a user's choice of layout arrangement.
Sequenced frames have some interesting HI requirements. Please refer to the HI guidelines for more information.